<?php

namespace app\controller\v1;

use app\model\MaterialCategoryModel;

class MaterialCategory extends System
{
    /**
     * Notes: 库存预警检测
     * User: chenLei
     * Date: 9/8/25
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function checkWarning()
    {
        $materialCategoryModel = new MaterialCategoryModel();
        $res = $materialCategoryModel->checkWarning();
        if ($res === false) {
            return $this->errorJson($materialCategoryModel->getError());
        }

        return $this->successJson('检测成功');
    }
}